package Chap11;

import java.util.Scanner;

public class UnusualTest
{
    public static void main(String[] args) throws StringTooLongException
    {
        String value1 = "",value = "";

        Scanner scan = new Scanner(System.in);
        StringTooLongException problem = new StringTooLongException("String is to long!!!");

        System.out.print("Asser without any restraint(\"DONE\" to quit): ");
        value1 += scan.nextLine();

        while(value !="DONE")
        {
            if(value.equals("DONE"))
                break;
            else
            {
                System.out.print("Asser without any restraint(\"DONE\" to quit): ");
                value = scan.nextLine();
            }
            value1 += value;
        }
        if(value1.length() > 20)
        {
            throw problem;
        }
    }
}
